package avicit.bdp.dms.das.service;

import avicit.bdp.common.base.BaseService;
import avicit.bdp.common.service.dto.BdpColumnHistoryDTO;
import avicit.bdp.dms.das.dao.BdpDasColumnHistoryDao;

import avicit.platform6.core.exception.BusinessException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author yangpf
 */
@Transactional
@Service
public class BdpDasColumnHistoryService extends BaseService<BdpDasColumnHistoryDao, BdpColumnHistoryDTO> {

    public void deleteByTableId(String tableId) {
        if (StringUtils.isEmpty(tableId)) {
            throw new BusinessException("删除失败！传入的参数主键为null");
        }
        try {
            BdpColumnHistoryDTO bdpDasColumnDTO = new BdpColumnHistoryDTO();
            bdpDasColumnDTO.setTableId(tableId);
            delete(bdpDasColumnDTO);
        } catch (Exception e) {
            throw new BusinessException(e.getMessage(), e);
        }
    }
}